import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Video Carousel')),
        body: Column(
          children: [
            MyApp(),
            SizedBox(height: 20),
            ClipImage(),
            SizedBox(height: 20),
            LocalImage(),
          ],
        ),
      ),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        //alignment: Alignment.center,
        width: 300,
        height: 300,
        decoration: BoxDecoration(color: Colors.yellow),
        child: Image.network(
          "https://img10.360buyimg.com/n1/s720x720_jfs/t1/355106/24/1395/178875/69059e76F2c788889/7ccf4f785bda2920.jpg",
          scale: 5,
          // alignment: AlignmentGeometry.centerLeft,
        ),
      ),
    );
  }
}

class MyButton extends StatelessWidget {
  const MyButton({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 40,
      // alignment: Alignment.center,
      margin: EdgeInsets.fromLTRB(0, 40, 0, 0),
      padding: EdgeInsets.fromLTRB(40, 0, 0, 0),
      decoration: BoxDecoration(
        color: Colors.lightBlue,
        borderRadius: BorderRadius.circular(10),
      ),
      child: Text("按钮", style: TextStyle(color: Colors.white, fontSize: 20)),
    );
  }
}

class ClipImage extends StatelessWidget {
  const ClipImage({super.key});

  @override
  Widget build(BuildContext context) {
    return ClipOval(
      child: Image.network(
        "https://img10.360buyimg.com/n1/s720x720_jfs/t1/355106/24/1395/178875/69059e76F2c788889/7ccf4f785bda2920.jpg",
        width: 150,
        height: 150,
        fit: BoxFit.cover,
      ),
    );
  }
}

class LocalImage extends StatelessWidget {
  const LocalImage({super.key});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 150,
      height: 150,
      child: Image.asset("images/a.jpg", fit: BoxFit.cover),
    );
  }
}
